
//- This source code is licensed under the terms of the
//- GNU Affero General Public License found in the LICENSE file in
//- the root directory of this source tree.
//-
//- Copyright (c) 2021-present Kaleidos INC

section.comments
    tg-comment-wysiwyg(
        tg-check-permission="{{::vm.canAddCommentPermission}}"
        type="vm.type"
        ng-if="!vm.reverse"
    )

    .comments-wrapper
        tg-comment.comment(
            ng-repeat="comment in vm.comments track by comment.id"
            ng-class="{'deleted-comment': comment.delete_comment_date}"
            comment="comment"
            name="{{vm.name}}"
            project="vm.project"
            loading="vm.loading"
            editing="vm.editing"
            deleting="vm.deleting"
            object="{{vm.object}}"
            edit-mode="vm.editMode[comment.id]"
            on-edit-mode="vm.onEditMode({commentId: commentId})"
            on-delete-comment="vm.onDeleteComment({commentId: commentId})"
            on-restore-deleted-comment="vm.onRestoreDeletedComment({commentId: commentId})"
            on-edit-comment="vm.onEditComment({commentId: commentId, commentData: commentData, callback: callback})"
        )

    tg-comment-wysiwyg(
        tg-check-permission="{{::vm.canAddCommentPermission}}"
        type="vm.type"
        ng-if="vm.reverse"
    )
